# for i in range(5):
#      print(i)

# 高斯求和
# result = 0
# for i in range(101):
#     result += i
# print(result)


# 1！+ 2！+ 3！....+n!

# n = 4
# result = 1
# for i in range(n + 1):
#     if i > 0:
#         result *= i
# print(result)

sum = 0
for n in range(5):
    result = 1
    if n > 0:
        for i in range(n+1):
            if i > 0:
                result *= i
        print(result)
        sum += result
print(sum)